package com.free.semantic.core.impl.demo.sample.baseConcept;

import com.free.semantic.core.ConceptManage;
import com.free.semantic.req.RelationDefineGroup;
import com.free.semantic.utils.Utils;

public class BaseConcept extends Utils {


    /**
     * 接口层事物定义
     *
     * @return
     */
    public static ConceptManage getDefaultConcept() {


        RelationDefineGroup group = new RelationDefineGroup();

        defineRelation(group, "属性",
                defineItem(oneObj("A"), oneObj("B"))); //A->B=[0,) //代表 针对任意一个A，都可以找到 [0,)个B与之对应

        defineRelation(group, "关联1",
                defineItem(oneObj("A"), oneObj("B")));

        defineRelation(group, "找到多个",
                defineItem(oneObj("A"), moreObj("B")));

        defineRelation(group, "多个找到",
                defineItem(oneObj("A"), moreObj("B")));

        defineRelation(group, "关联4",
                defineItem(oneObj("A","B","C","D"), oneObj("E")));

        defineRelation(group, "lessOne4",
                defineItem(lessOneObj("A","B","C","D"), oneObj("E")));

        defineRelation(group, "继承",
                defineItem(oneObj("A"), oneObj("B"))); //A->B=[0,) //代表 针对任意一个A，都可以找到 [0,)个B与之对应

        defineRelation(group, "查询属性",
                defineItem(oneObj("B"), moreObj("A"))); //A->B=[0,) //代表 针对任意一个A，都可以找到 [0,)个B与之对应

        defineRelation(group, "关联单据",
                defineItem(oneObj("A"), oneObj("B"))); //A->B=[0,) //代表 针对任意一个A，都可以找到 [0,)个B与之对应


        ConceptManage conceptManage = getConceptManage(group);

        object(conceptManage, "pageParam");
        object(conceptManage, "entity");
        object(conceptManage, "attr");
        object(conceptManage, "create");
        object(conceptManage, "update");
        object(conceptManage, "delete");

        return conceptManage;

    }


}
